<%@ page language="java" import="java.util.*,com.hs.auth.model.*,com.hs.core.utils.*" pageEncoding="utf-8"%>
<%
PageUtil pageUtil = (PageUtil)request.getAttribute("dataList");
String orgname = (String)request.getAttribute("orgname");
 
List dataList = null;
String pageStr = "";
int perpageCount = 0;
int currentPage = 0;
if(pageUtil != null){
	   dataList = pageUtil.getPageList();
	   pageStr = pageUtil.getPageStr();
	   perpageCount = pageUtil.getNumberPerPage();
	   currentPage = pageUtil.getCurrentPage();
}

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../include.jsp"%>   
<style>.tac{text-align:center}</style>
<script>
function searchData(){

searchform.submit();
}

function modifyData(id){
	
     window.parent.oper.frameElement.src = "<%=basePath%>auth/orgInfo.do?id="+id; 
     //alert(window.parent.oper.frameElement.src)
 
}
 function deleteOrg(id){
 	if(confirm("确定要删除该单位吗?")){
 		authdwr.deleteOrg(id,callback4delete);
 	}
 }
 function callback4delete(){
    alert("成功删除单位!");
    searchform.submit();
    window.parent.list.frameElement.src = "<%=basePath%>auth/listOrg.do";
     
    
 }
 function addOrg(){
 	     window.parent.oper.frameElement.src = "<%=basePath%>auth/orgInfo.do"; 
 	
 
 }
 
</script>
</head>
<body class="cont_body">
    <div class="cont">     
    <form name="searchform" action="<%=basePath %>auth/listOrg.do" method="post">
       
        <div class="sear">
            单位名称：
            <input name="orgname" type="text"   value="<%=orgname==null?"":orgname %>"  /> 
            
            <input onclick="searchData();" type="button" value="查询" class="butt2"/> 
            <input onclick="addOrg();" type="button" value="新增单位" class="butt2"/> 
		</div>
        </form>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
          <tr> 
            <th width="5%">序号</th>
            <th width="30%">单位名称</th>
            <th width="15%">组织代码</th>
            <th width="20%">单位性质</th> 
            <th width="15%">修改</th> 
            <th width="15%">删除</th> 
          </tr>
          <%if(dataList != null && dataList.size()>0){ 
			    for(int i =0;i<dataList.size();i++){
			       HsOrg obj = (HsOrg)dataList.get(i); 
 			%>
			<tr> 
			<td align=center><%=perpageCount*(currentPage-1)+i+1 %></td>
			<td align=left><%=obj.getOrgname() %></td>
			<td align=center><%=StringUtilTool.NULL2Blank(obj.getOrgcode()) %></td>
			<td align=center></td> 
			<td align="center"><input onclick="modifyData('<%=obj.getId() %>');" type="button" value="修改"  class="butt2"/></td>
			<td align="center"><input onclick="deleteOrg('<%=obj.getId() %>');" type="button" value="删除" class="butt2"/> </td> 
			 
			</tr> 
			<%}}else{ %>
			<tr>
            <td colspan=6 align="center"><font color=red><strong>当前没有单位信息！</strong></font></td>
          </tr>
          <%} %>
          <tr>
          <td colspan=8>
          <%=pageStr  %>
          </td>
          </tr>
        </table>
		
        
  </div>

</body>
</html>
